import http from "@/api/http";

export class MenuService {
    /**
     * 获取菜单列表
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static GetMenuList() {
        return http({
            url: '/api/menu/lists',
            method: 'get'
        })
    }

    /**
     * 添加菜单方法
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static AddMenu(query) {
        return http({
            url: '/api/menu/add',
            data: query,
            method: 'post'
        })
    }

    /**
     * 根据id删除菜单
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static DeleteMenuById(query) {
        return http({
            url: '/api/menu/del',
            data: query,
            method: 'post'
        })
    }

    /**
     * 获取菜单详情
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static GetMenuById(query) {
        return http({
            url: '/api/menu/detail',
            data: query,
            method: 'post'
        })
    }

    /**
     * 修改菜单信息
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static ModifyMenuById(query){
        return http({
            url:'/api/menu/edit',
            data:query,
            method:'post'
        })
    }
}
